package com.sh.shanhuo.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sh.shanhuo.R;
import com.sh.shanhuo.bean.NoticeListBean;

import java.io.IOException;
import java.net.URL;
import java.util.List;

public class NoticeAdapter extends BaseQuickAdapter<NoticeListBean.RowsBean, BaseViewHolder> {

    private final Context context;

    public NoticeAdapter(Context context, List<NoticeListBean.RowsBean> dataBeans) {
        super(R.layout.notice_view, dataBeans);
        this.context = context;
    }

    @Override
    @SuppressLint("UseCompatLoadingForDrawables")
    protected void convert(BaseViewHolder helper, NoticeListBean.RowsBean item) {
        TextView noticeTitle = helper.getView(R.id.noticeTitle);
        TextView noticeTime = helper.getView(R.id.noticeTime);
        TextView noticeContent = helper.getView(R.id.noticeContent);
        noticeTime.setText(item.getUpdateTime());
        /*if (item.getRemark().equals("0")) {
            noticeTitle.setTextColor(context.getResources().getColor(R.color.item_uncheck, null));
            noticeTime.setTextColor(context.getResources().getColor(R.color.item_uncheck, null));
            noticeContent.setTextColor(context.getResources().getColor(R.color.item_uncheck, null));
        } else {*/
        noticeTitle.setTextColor(context.getResources().getColor(R.color.black, null));
        noticeTime.setTextColor(context.getResources().getColor(R.color.notice_time, null));
        noticeContent.setTextColor(context.getResources().getColor(R.color.notice_content, null));
        /*}*/
        noticeContent.setText(item.getContent());
        noticeContent.setText(item.getContent());
    }
}
